<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>访客申请-云校通</title>
<jsp:include page="/WEB-INF/page/common/_header.jsp"></jsp:include>
</head>
<body ontouchstart style="background: #fff;">
<div class="weui_tab tab-bottom">
	<div class="weui_tab_bd">
		<div class="weui-header bg-blue"> 
			<div class="weui-header-left"> <a onclick="back()" class="icon icon-109 f-white">返回</a></div>
			<h1 class="weui-header-title">访客详情</h1>
		</div>
		<div class="weui_cells afterNone afterNoneBefore">
			<c:if test="${empty error }">
		        <div style="text-align: center;margin: 0 auto;">
		        	<h2 class="mb10">${detail.visitorName },您好！</h2>
		        	<h4>进出学校大门的二维码</h4>
					<div id="qrcode" style="left:10%;position: relative;top: 20px;">
					</div>
					<h4 class="mt40">二维码有效时间(<fmt:formatDate value="${detail.visitStartTime}" pattern="yyyy-MM-dd HH:mm" />-<fmt:formatDate type="time" timeStyle="short" value="${detail.visitEndTime}"/>)</h4>
				</div>
			</c:if>
		</div>
	</div>
</div>
<script src="<%=basePath %>/js/qrcode.js" type="text/javascript"></script>
<script type="text/javascript">
	if("${error}" == "") {
		$('#qrcode').qrcode({
		    render: "table",
		    size: 300,
		    top: 40,
		    bottom: 40,
		    text: "${detail.qrCode}"
		});
	}else {
		$.alert("${error}", "");
	}

</script>
</body>
</html>